|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectj3deditor.bin.hierarchy.HierarchyNode
j3deditor.bin.hierarchy.J3DeObject
public class J3DeObject
Base class for transformable objects.
Contains an instance of
javax.media.j3d.TransformGroup and
javax.media.j3d.Node attached to it
TransformGroup| Constructor Summary | |
|---|---|
J3DeObject(java.lang.String name,
HNodeType type,
long numOfNodes)
Creates an instance of J3DeObject with
the given name, type and index. |
|
| Method Summary | |
|---|---|
protected HierarchyNode |
clone(HierarchyNode node)
Clones this node. |
void |
delete()
Removes this node from its parent. |
protected javax.media.j3d.Node |
get3DObject()
Returns the Java 3D Node attached
to this nodes TransformGroup. |
javax.media.j3d.TransformGroup |
getObject()
Returns the TransformGroup object
of this node. |
float |
getRotationZ()
Returns the rotation around Z-axis. |
float |
getRotationX()
Returns the rotation around X-axis. |
float |
getRotationY()
Returns the rotation around Y-axis. |
float |
getScaleZ()
Returns the scale on Z-axis. |
float |
getScaleX()
Returns the scale on X-axis. |
float |
getScaleY()
Returns the scale on Y-axis. |
float |
getTranslationZ()
Returns the position on Z-axis. |
float |
getTranslationX()
Returns the position on X-axis. |
float |
getTranslationY()
Returns the position on Y-axis. |
void |
initObject(javax.media.j3d.Node object)
Attaches the given Java 3D object to the TransformGroup inside this node. |
void |
rotate(float x,
float y,
float z)
Sets the given absolute angle on each axis. |
void |
rotateZ(float angle,
boolean isLocal)
Rotates the object around the Z-axis. |
void |
rotateX(float angle,
boolean isLocal)
Rotates the object around the X-axis. |
void |
rotateY(float angle,
boolean isLocal)
Rotates the object around the Y-axis. |
void |
scale(float x,
float y,
float z)
Sets the given absolute scale on each axis. |
void |
scaleAll(float difference)
Resizes this object on all axes. |
void |
scaleZ(float difference,
boolean isLocal)
Resizes this object on Z-axis. |
void |
scaleX(float difference,
boolean isLocal)
Resizes this object on X-axis. |
void |
scaleY(float difference,
boolean isLocal)
Resizes this object on Y-axis. |
protected void |
setNode(javax.media.j3d.Node node)
Replaces the TransformGroup object of
this node with the given object and sets its capabilities. |
void |
setObject(javax.media.j3d.TransformGroup transform)
Copies the transformation from the given TransformGroup object
to the TransformGroup object of this node. |
void |
translate(float x,
float y,
float z)
Sets the given absolute translation on each axis. |
void |
translateZ(float z,
boolean isLocal)
Moves the object along the Z-axis. |
void |
translateX(float x,
boolean isLocal)
Moves the object along the X-axis. |
void |
translateY(float y,
boolean isLocal)
Moves the object along the Y-axis. |
| Methods inherited from class j3deditor.bin.hierarchy.HierarchyNode |
|---|
equals, getChild, getIndex, getIndexOfChild, getNumberOfChildren, getParent, getParent, getType, hasNamedChild, removeChild, setName, setParent, toString, updateName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public J3DeObject(java.lang.String name,
HNodeType type,
long numOfNodes)
J3DeObject with
the given name, type and index.
name - the name of this objecttype - the type of this objectnumOfNodes - the index of this object| Method Detail |
|---|
public void initObject(javax.media.j3d.Node object)
TransformGroup inside this node.
object - object to be attached topublic javax.media.j3d.TransformGroup getObject()
TransformGroup object
of this node.
TransformGroup object
of this nodeprotected javax.media.j3d.Node get3DObject()
Node attached
to this nodes TransformGroup.
Node object
contained in this nodepublic void setObject(javax.media.j3d.TransformGroup transform)
TransformGroup object
to the TransformGroup object of this node.
transform - transformation object the transformation will be copied from
protected void setNode(javax.media.j3d.Node node)
throws java.lang.Exception
TransformGroup object of
this node with the given object and sets its capabilities.
node - new TransformGroup object
java.lang.Exception - if the given node is not an
instance of TransformGroup or it does not
have any childrenprotected HierarchyNode clone(HierarchyNode node)
clone in class HierarchyNodenode - node sent by subclass
public void delete()
throws java.lang.Exception
delete in interface Deletablejava.lang.Exception - if cannot remove the TransformGroup
object of this node from its parent or this node has no parent
public void translateX(float x,
boolean isLocal)
x - specifies how much this object will be movedisLocal - specifies whether the object is moved along its local axes
or along the axes of scene
public void translateY(float y,
boolean isLocal)
y - specifies how much this object will be movedisLocal - specifies whether the object is moved along its local axes
or along the axes of scene
public void translateZ(float z,
boolean isLocal)
z - specifies how much this object will be movedisLocal - specifies whether the object is moved along its local axes
or along the axes of scene
public void translate(float x,
float y,
float z)
x - absolute translation on X-axisy - absolute translation on Y-axisz - absolute translation on Z-axispublic float getTranslationX()
public float getTranslationY()
public float getTranslationZ()
public void scaleX(float difference,
boolean isLocal)
difference - specifies how much the object will be resizedisLocal - has no effect yet
public void scaleY(float difference,
boolean isLocal)
difference - specifies how much the object will be resizedisLocal - has no effect yet
public void scaleZ(float difference,
boolean isLocal)
difference - specifies how much the object will be resizedisLocal - has no effect yetpublic void scaleAll(float difference)
difference - specifies how much the object will be resized
public void scale(float x,
float y,
float z)
x - absolute scale on X-axisy - absolute scale on Y-axisz - absolute scale on Z-axispublic float getScaleX()
public float getScaleY()
public float getScaleZ()
public void rotateX(float angle,
boolean isLocal)
angle - specifies how much the angle will be changedisLocal - specifies whether the object is rotated around its local axes
or around the axes of scene
public void rotateY(float angle,
boolean isLocal)
angle - specifies how much the angle will be changedisLocal - specifies whether the object is rotated around its local axes
or around the axes of scene
public void rotateZ(float angle,
boolean isLocal)
angle - specifies how much the angle will be changedisLocal - specifies whether the object is rotated around its local axes
or around the axes of scene
public void rotate(float x,
float y,
float z)
x - absolute angle around X-axis in degreesy - absolute angle around Y-axis in degreesz - absolute angle around Z-axis in degreespublic float getRotationX()
public float getRotationY()
public float getRotationZ()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||